package cn.aylog.springboot.entity.vo;

import cn.aylog.servicebase.annotations.QueryBetween;
import cn.aylog.servicebase.annotations.QueryEquals;
import cn.aylog.servicebase.annotations.QueryLike;
import cn.aylog.servicebase.utils.MpUtils;
import cn.aylog.springboot.entity.Teacher;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
public class TeacherQuery {
    @QueryLike
    @ApiModelProperty("讲师ID")
    private String id;

    @QueryLike
    @ApiModelProperty(value = "讲师姓名", dataType = "string")
    private String name;

    @QueryEquals
    @ApiModelProperty(value = "头衔 1高级讲师 2首席讲师", example = "1")
    private Integer level;


    @QueryBetween(value = "gmt_create", start = true)
    @ApiModelProperty(value = "开始创建时间", example = "2019-1-1 00:00:00")
    private Date start;

    @QueryBetween("gmt_create")
    @ApiModelProperty(value = "结束创建时间", example = "2019-1-1 00:00:00")
    private Date end;

    public QueryWrapper<Teacher> createQueryWrapper() {
        return MpUtils.createQueryMapper(this);
    }
}
